import typing
import cdp.debugger as debugger
import cdp.runtime as runtime

def fix_CallFrame_from_json(json: typing.Dict[str, typing.Any]) -> debugger.CallFrame:
    return debugger.CallFrame(
        call_frame_id=debugger.CallFrameId.from_json(json['callFrameId']),
        function_name=str(json['functionName']),
        location=debugger.Location.from_json(json['location']),
        url=str(json['url']),
        scope_chain=[debugger.Scope.from_json(i) for i in json['scopeChain']],
        this=runtime.RemoteObject.from_json(json['this']) if 'this' in json else None,
        function_location=debugger.Location.from_json(json['functionLocation']) if 'functionLocation' in json else None,
        return_value=runtime.RemoteObject.from_json(json['returnValue']) if 'returnValue' in json else None,
    )

debugger.CallFrame.from_json = fix_CallFrame_from_json
